<include file="Public/head" />
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar" menu="cljc.jcsh"/>
 <if condition="$total_car  gt '1' ">
    <div class="presentation">
        <span><a class="leftBtn" style="display: none"></a><a class="rightBtn"></a></span>
        <div>
            <ul class="clearfix">
                <foreach name="car_id_list" item="car_item" key="key">
                    <li class= "<?php echo $car_id == $car_item['car_id'] ? 'cuurent' : ''; ?>"><a href="/DetectionCheck/check/car_id/{$car_item.car_id}" >报告<?php echo $total_car - $key;?></a></li>
                </foreach>
            </ul>
        </div>
    </div>
 </if>
    <div class="mianR">
        {$report}
        <div class="frame clearfix"><span>车架号</span><em>{$car.vin}</em></div>
        <div class="testing">
            <h4>行驶证照片</h4>
            <ul>
                <li class="agreement1 clearfix">
                  <?php if($procedure['travel_license_pic']):?>
                    <span>
                        <img src="{$procedure.travel_license_pic}@216h_180w" />
                        <em>行驶证照片点击看大图</em>
                    </span>
                  <?php endif;?>
                  <?php if($procedure['travel_license_pic2']):?>
                    <span>

                        <img src="{$procedure.travel_license_pic2}@216h_180w" />
                        <em>行驶证照片点击看大图</em>
                    </span>
                  <?php endif;?>
                  <?php if($procedure['travel_license_pic3']):?>
                    <span>
                        <img src="{$procedure.travel_license_pic3}@216h_180w" />
                        <em>行驶证照片点击看大图</em>
                    </span>
                  <?php endif;?>
                </li>
            </ul>
        </div>
        <div class="testing">
            <h4>登记证照片</h4>
            <ul class="clearfix">
                <li class="agreement1 clearfix">
                  <span>
                    <?php if($procedure['reg_cert_pic']):?>
                      <img src="{$procedure.reg_cert_pic}@216h_180w" /><em>登记证照片点击看大图</em>
                    <?php endif;?>
                  </span>

                  <span>
                    <?php if($procedure['reg_cert_pic2']):?>
                      <img src="{$procedure.reg_cert_pic2}@216h_180w" /><em>登记证照片点击看大图</em>
                    <?php endif;?>
                  </span>
                  <span>
                    <?php if($procedure['reg_cert_pic3']):?>
                      <img src="{$procedure.reg_cert_pic3}@216h_180w" /><em>登记证照片点击看大图</em>
                    <?php endif;?>
                  </span>
                </li>
            </ul>
        </div>

        <div class="testing">
            <h4>协议详情</h4>
            <ul class="clearfix">
                <li class="agreement clearfix">
                    <span>过户限制</span>
                    <em>{$car.transfer_limit}</em>
                    <span>建议起拍价</span>
                    <em>{$car.suggest_bid_start_price}</em>
                    <span>保留价</span>
                    <em>{$car.reserve_price}</em>
                    <span>建议价</span>
                    <em>{$car.suggest_price}</em>
                </li>
                <li class="agreement1 clearfix">
                    <span><img src="{$procedure.protocol_pic}@216h_180w" /><em>协议照片点击看大图</em></span>
                </li>
            </ul>
        </div>
        <if condition="$car.car_status eq 1">
            <div class="testing">
                <h4>审核结果</h4>
                <ul class="shenhei-tongguo">
                    <li class="trial clearfix">

                            <input class="sheng_hover approve" data-id="1" type="button"  value="审核通过" >

                        <input class="no-pass" data-id="3" type="button" value="审核驳回">
                        <input class="no-pass" data-id="2" type="button" value="审核失败">
                    </li>
                </ul>
                <div class="textarea-content">
                    <div class="textarea-list" style="display: block;">

                    </div>
                    <div class="textarea-list clearfix" style="display: none;">
                        <span>*备注</span>
                        <textarea id="reject_area" placeholder="请填写驳回原因，此项为必填写"></textarea>
                    </div>
                    <div class="textarea-list clearfix" style="display: none;">
                        <span>*备注</span>
                        <textarea id="faild_area" placeholder="请填写失败原因，此项为必填写"></textarea>
                    </div>
                </div>
            </div>
        </if>
        <div class="yongBtn1" style="display: none;">
            <input id="sub_check" type="submit" value="确定" class="queding" />
        </div>
        <div class="clear"></div>
    </div>
</div>
<script type="text/javascript" src="{:get_style_cdnurl()}paimai/yunying/js/jquery.rotate.min.js"></script>

<!--弹出框效果-->
<div class="sunbox-alret">
<img src="" />

</div>
<div class="fork"></div>
<div class="xuanzhuan"></div>
<div class="xie-loading"></div>

    <script type="text/javascript">
    $(document).ready(function() {

        $(".testing ul .agreement1 span").click(function(){
            var Img=$(this).find("img").attr("src").split("@");
            $(".xuanzhuan").fadeIn();
            $(".fork").fadeIn();
            $(".pageBeijing").css("display","block");
            $(".xie-loading").fadeIn();

            $(".sunbox-alret img").attr("src",Img[0]).get(0).onload=function(){
                $(".sunbox-alret").fadeIn();
                $(".sunbox-alret").rotate(0);
                $(".xie-loading").fadeOut();
                $(".sunbox-alret").css("top",$(window).scrollTop());
                $(".sunbox-alret").css({
                    "marginTop":100,
                    "marginLeft":-$(".sunbox-alret").outerWidth()/2
                })
            };
        })
        var num = 0;
        $(function(){
            $(".xuanzhuan").click(function(){
                num ++;
                $(".sunbox-alret").rotate(90*num);
            })
        })

        $(".fork").click(function(){
            $(".pageBeijing").css("display","none");
            $(".sunbox-alret").fadeOut();
            $(".xuanzhuan").fadeOut();
            $(".fork").fadeOut();
            $(".xie-loading").fadeOut();
            $(".sunbox-alret img").attr("src","");
            num = 0;
        })

        // 历史报告切换
        $(function(){
            $(".presentation span").hide();
            var oLiNum=$(".presentation ul li").length;
            var oLiW=$(".presentation ul li").width()*oLiNum;
            var num=0;
            if(oLiW>920){
                $(".presentation span").show();
            }else{
                $(".presentation span").hide();
            }
            $(".presentation span .leftBtn").hide();

            $(".presentation span .rightBtn").click(function(){
                $(".presentation span .leftBtn").show()
                num++;
                $(".presentation ul").animate({
                    "marginLeft":-$(".presentation ul li").width()*num+"px"
                });
                var wMin=-(oLiNum-9)*$(".presentation ul li").width();
                if(wMin==-$(".presentation ul li").width()*num){
                    $(".presentation span .rightBtn").hide();
                }
            })
            $(".presentation span .leftBtn").click(function(){
                num--;
                $(".presentation ul").animate({
                    "marginLeft":-$(".presentation ul li").width()*num+"px"
                });
                $(".presentation span .rightBtn").show();
                if(-$(".presentation ul li").width()*num>=0){
                    $(".presentation span .leftBtn").hide();

                }
            })
            $(".presentation ul li").click(function(){
                $(".presentation ul li").removeClass("cuurent");
                $(this).addClass("cuurent");
                var index=$(".presentation ul li").index(this);
                $(".presentation-cont .jianCeBox").eq(index).show().siblings().hide();
            })
        })

    });    
        $(".approve").click(function(){
            confirm_alert('<div style="color:red">确定审核成功吗？</div>', confirm);
            function confirm() {
                $('.determine').click(function () {
                    colse_hide();
                    postCheck(1,'');
                });
            }

        });        
                
        $("#sub_check").click(function(){
            var status = $(".sheng_hover").attr("data-id");
            var msg = (status==3) ? "确定审核驳回吗" : "确认审核失败吗?" ;
            confirm_alert('<div style="color:red">'+ msg +'</div>', confirm_rejected);
            function confirm_rejected(){
                $('.determine').click(function () {
                    var status = $(".sheng_hover").attr("data-id");
                    var remark = '';
                    if(status==3){
                        remark = $("#reject_area").val();
                    }
                    if(status==2){
                        remark = $("#faild_area").val();
                    }
                    if(remark==''){
                        shibai_alert("备注为必选项", 1500);
                        return false;
                    }
                    postCheck(status,remark);
                });
            }
        });
        
        function postCheck(status,remark){
            $.post("/DetectionCheck/saveCheck",{"remark":remark,"status":status,"car_id":<?php echo $car['car_id'];?>},function(data){
                if(data.code!=200){
                    shibai_alert(data.msg, 1500);
                    return false;
                }
                btn_alert("操作成功",1500, function(){
                    //location.href=document.referrer
                    $(window.opener.document).find(".suoSou").trigger("click");
                    colse_hide();
                    self.close();
                });
            },"json");
        }
    </script>
    <div class="xieyi"><span>×</span><img src="#" /></div>
<include file="Public/foot" />
